<script setup lang="ts">

import {useRoute} from "vue-router";
import {ref} from "vue";
// 当前路由信息
const route = useRoute();

const editUser = ref({
  editKey: route.query.editKey as string,
  curValue: route.query.curValue as string,
  editName: route.query.editName as string,
})
const onSubmit = (values: any) => {
  console.log(values);
  alert('提交成功');
};

</script>

<template>
  <div id="userEdit">
    <van-form @submit="onSubmit">
      <van-cell-group inset>
        <van-field
            v-model="editUser.curValue"
            :name="editUser.editKey"
            :label="editUser.editName"
            :placeholder="`请输入${editUser.editName}`"
            :rules="[{ required: true, message: '请填写用户名' }]"
        />
      </van-cell-group>
      <div style="margin: 16px;">
        <van-button round block type="primary" native-type="submit">
          提交
        </van-button>
      </div>
    </van-form>

  </div>

</template>

<style scoped>

</style>